//
//  SecondController.swift
//  LiteAccount
//
//  Created by 刘伟 on 2017/5/8.
//  Copyright © 2017年 刘伟. All rights reserved.
//

import UIKit

class SecondController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.isHeroEnabled = true
        // Do any additional setup after loading the view.
        self.edgesForExtendedLayout = .init(rawValue: 0)
        redView.heroID = "foo"
        greyView.heroID = "bar"
        self.view.addSubview(redView)
        self.view.addSubview(greyView)
        self.view.addSubview(whiteView)
        redView.snp.makeConstraints { (make) in
            make.edges.equalToSuperview()
        }
        greyView.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.top.equalTo(20)
            make.width.equalTo(200)
            make.height.equalTo(50)
        }
        
        redView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(back)))
    }
    
    func back() {
        self.dismiss(animated: true, completion: nil)
    }
    

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    lazy var redView: UIView = {
        let object = UIView()
        object.backgroundColor = .red
        return object
    }()
    
    lazy var whiteView: UIView = {
        let object = UIView()
        object.backgroundColor = .white
        return object
    }()
    
    lazy var greyView: UIView = {
        let object = UIView()
        object.backgroundColor = .gray
        return object
    }()

}
